package com.ws.universal.tools.takephoto.multipleimageselect.models;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @创建者 ws
 * @TIME 2021/8/11 15:03
 * @描述
 */
public class ImageBean implements Parcelable {
    public static final Creator<ImageBean> CREATOR = new Creator<ImageBean>() {
        @Override
        public ImageBean createFromParcel(Parcel source) {
            return new ImageBean(source);
        }

        @Override
        public ImageBean[] newArray(int size) {
            return new ImageBean[size];
        }
    };
    public long id;
    public String name;
    public String path;
    public long duration;
    public String type;
    public boolean isSelected;

    public ImageBean(long id, String path, long duration, String type, boolean isSelected) {
        this.id = id;
        this.path = path;
        this.duration = duration;
        this.type = type;
        this.isSelected = isSelected;
    }

    private ImageBean(Parcel in) {
        id = in.readLong();
        name = in.readString();
        path = in.readString();
        duration = in.readLong();
        type = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(name);
        dest.writeString(path);
        dest.writeLong(duration);
        dest.writeString(type);
    }

    @Override
    public String toString() {
        return "Image{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", path='" + path + '\'' +
                ", duration=" + duration +
                ", type='" + type + '\'' +
                ", isSelected=" + isSelected +
                '}';
    }
}
